package com.huika.dealontop.control.homepage.utils.fourad;

import android.app.Activity;
import android.view.View;

import com.huika.dealontop.GlobalApp;
import com.huika.dealontop.R;
import com.huika.dealontop.control.homepage.utils.fourad.basefourad.BaseFourAd;
import com.huika.dealontop.support.domain.HomePageAdvertisementSeatInfo;

import java.util.ArrayList;

;
;

/**
 * Created by cailu on 2016/1/13.
 */
public class TwoAd extends BaseFourAd {

    private View mView;


    public TwoAd(Activity context, ArrayList<HomePageAdvertisementSeatInfo> info) {
        super(context, info);
    }

    @Override
    protected void initWidget() {
        initHomePageFourAdvertisementDatas();
    }

    @Override
    protected void widgetClick(View v) {

    }

    @Override
    protected View initRoot() {
        mView = View.inflate(mContext, R.layout.item_twoad, null);
        return mView;
    }


    public View getAdView() {
        return mView;
    }

    private void initHomePageFourAdvertisementDatas() {

        //int widthPixel = mWidthPixels - UIUtils.dip2px(1);
        double width = mWidthPixels / 2.0;

        setLayoutParamsHW(mAdvertisementOne, (int) width, (int) (mWidthPixels / 640.0 * 142));

       setLayoutParamsHW(mAdvertisementTwo, (int) width, (int) (mWidthPixels / 640.0 * 142));

        GlobalApp.loadImg(mAdvertisementTwo, mHomePageFourAdvertisementLists.get(1).getAdPic());

        GlobalApp.loadImg(mAdvertisementOne, mHomePageFourAdvertisementLists.get(0).getAdPic());

    }
}
